<template>
  <modal-frame
    ref="modalFrame"
    :modalWith="500"
    title="提示"
  >
    <div style="height: 130px;">
      <div style="text-align: center;margin-top: 60px">
        <p>你确定要删除该产品吗？</p>
      </div>
    </div>
    <div slot="footer">
      <el-button @click="hide">取消</el-button>
      <el-button class="btn primary green btn-sm" :loading="loading"
                 @click="submit()">确认</el-button>
    </div>
  </modal-frame>
</template>
<script>
import modalFrame from 'components/base/modalFrame'
import {httpGetDetail} from 'assets/scripts/base/util'
import {alert} from 'assets/scripts/base/functions'
export default {
  name: 'isEnable',
  components: {
    modalFrame
  },
  props: {
    goodId: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      loading: false
    }
  },
  methods: {
    submit() {
      this.loading = true
      httpGetDetail('/ms-fahuobao-order/fhbGoodAdmin/deleteGoodById', this, {goodId: this.goodId}).then(response => {
        this.loading = false
        this.$emit('refresh')
        alert('操作成功！', '提示', 'success')
        this.hide()
      })
    },
    show() {
      this.$refs.modalFrame.show()
    },
    hide() {
      this.$refs.modalFrame.hide()
    }
  }
}
</script>
